const app = getApp()
const request = require('../../utils/https.js')
import util from '../../utils/util.js';
Page({

  /**
   * 页面的初始数据
   */
  data: {
    isHideToast:false
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    const that = this;
    let userId = wx.getStorageSync('userId');
    //积分消费记录
    request._get(getApp().Api_url + 'user/myPointsDetail', {
      userId: userId,
      pageNum: 1,
      pageSize: 100
    }, function (res) {
      if (res.data.success == true) {
        console.log('积分消费记录==>', res.data)
        that.setData({
          info: res.data.info,
          DataIntergral: res.data.data
        })
      }
    }, function () { })
  },
  goShopping() {
    wx.switchTab({
      url: '/pages/list/list',
    })
  },
  //自定义弹框
  onToast() {
    const that = this;
    that.setData({
      isHideToast: true
    })
  },
  shutToast() {
    const that = this;
    that.setData({
      isHideToast: false
    })
  },
})